跳到主要内容

WEEKDAY

Returns a number from 1 to 7 identifying the day of the week of the specified date.

Syntax

expression.WEEKDAY(arg1, arg2);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRangeApiNamenumber
arg2RequiredApiRangeApiNamenumber

Returns

number

Example

const oWorksheet = Api.GetActiveSheet();

var oFunction = Api.GetWorksheetFunction();
var ans = oFunction.WEEKDAY("11/5/2018", 2);

oWorksheet.GetRange("C1").SetValue(ans);